package com.hymall.controller.admin;

import com.hymall.bean.common.BaseRespVo;
import com.hymall.bean.vo.AdminStatGoodsVO;
import com.hymall.bean.vo.AdminStatOrderVO;
import com.hymall.bean.vo.AdminStatUserVO;
import com.hymall.service.admin.AdminStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 章鹏
 * @description 配置管理 --> 商场配置
 * @date: 2022/7/17 16:17
 */
@RestController
@RequestMapping("admin/stat")
public class AdminStatController {

    @Autowired
    AdminStatService adminStatService;

    /**
     * @param []
     * @return com.hymall.bean.common.BaseRespVo
     * @author 章鹏
     * @description 统计报表 → 用户统计
     * @date 2022/7/17 17:35
     */
    @GetMapping("user")
    public BaseRespVo statUser() {
        AdminStatUserVO adminStatUserVO = adminStatService.statUser();
        return BaseRespVo.ok(adminStatUserVO);
    }

    /**
     * @param []
     * @return com.hymall.bean.common.BaseRespVo
     * @author 章鹏
     * @description 统计报表 → 订单统计
     * @date 2022/7/17 18:35
     */
    @GetMapping("order")
    public BaseRespVo statOrder() {
        AdminStatOrderVO adminStatOrderVO = adminStatService.statOrder();
        return BaseRespVo.ok(adminStatOrderVO);
    }


    /**
     * @param []
     * @return com.hymall.bean.common.BaseRespVo
     * @author 章鹏
     * @description 统计报表 → 商品统计
     * @date 2022/7/17 19:45
     */
    @GetMapping("goods")
    public BaseRespVo statGoods() {
        AdminStatGoodsVO adminStatGoodsVO = adminStatService.statGoods();
        return BaseRespVo.ok(adminStatGoodsVO);
    }

}
